package com.baihan.angus.app.game.common.data_center.remote.api;

import com.baihan.angus.app.game.basic.base.BaseResponse;
import com.baihan.angus.app.game.common.bean.response.RoomDetailResponse;
import com.baihan.angus.app.game.common.bean.response.SearchClueResponse;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;

public interface RoomServer {

    /**
     * 获取房间列表
     * @return
     */
    @GET("api/room")
    Observable<ResponseBody> getRoomList(@QueryMap Map<String, Object> pMap);

    /**
     * 创建房间
     * @return
     */
    @POST("api/room")
    Observable<ResponseBody> createRoom(@Body Map<String, Object> pMap);

    /**
     * 获取房间详情
     * @return
     */
    @GET("api/room/{sn}")
    Observable<ResponseBody> getRoomDetail(@Path("sn") String sn);

    /**
     * 进入房间
     * @return
     */
    @POST("api/room/join/{sn}")
    Observable<ResponseBody> enterRoom(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 退出房间
     * @return
     */
    @POST("api/room/logout/{sn}")
    Observable<BaseResponse> exitRoom(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 解散房间
     * @return
     */
    @POST("api/room/dissolution/{sn}")
    Observable<BaseResponse> dissolutionRoom(@Path("sn") String sn);

    /**
     * 更新房间(换本)
     * @return
     */
    @PUT("api/room/{sn}")
    @FormUrlEncoded
    Observable<BaseResponse> updateRoom(@Path("sn") String sn, @Field("script_id") String script_id);

    /**
     * 获取房间详情
     * @return
     */
    @GET("api/room/{sn}")
    Observable<RoomDetailResponse> updateRoomDetail(@Path("sn") String sn);

    /**
     * 查看线索
     * @return
     */
    @POST("api/room/clue/{sn}")
    Observable<BaseResponse> viewClues(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 选择角色
     * @return
     */
    @POST("api/room/role/{sn}")
    Observable<BaseResponse> chooseScriptRole(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 问题答案上传
     * @return
     */
    @POST("api/room/question/{sn}")
    Observable<BaseResponse> answer(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 投票
     * @return
     */
    @POST("api/room/vote/{sn}")
    Observable<BaseResponse> vote(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * 线索搜证
     * @return
     */
    @POST("api/room/clue_search/{sn}")
    Observable<SearchClueResponse> searchClue(@Path("sn") String sn, @Body Map<String, Object> pMap);

    /**
     * mvp
     * @return
     */
    @POST("api/room/mvp/{sn}")
    Observable<BaseResponse> chooseMvp(@Path("sn") String sn, @Body Map<String, Object> pMap);
}
